{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}
{script src='js/attachment.js'}
{script src=js/tablesorter.js}
{style href="style/`$agora_config.o_default_style`/common.css"}
{style href="style/`$agora_config.o_default_style`/index.css"}

<div class="ag_agora">

	<div class="ag_rightend">
		<h2 class="ag_headerbar"><span class="ag_middle">##Upload_title_2##</span></h2>
	</div>

	<div class="ag_outerwrap">
		<form method="post" action="{url task=upload action=add type=#}" enctype="multipart/form-data">
			<fieldset class="ag_inform">
				<legend class="ag_color">##upload_legend##</legend>
				<div class="ag_infldset">
					<input type="file" id="upload" name="upload" style="width:99%;" />
					<br /><br />
					<label for="upload_name" class="ag_label">
						<strong>##upload_file_name##</strong>
						<input type="text" id="upload_name" name="upload_name" style="width:99%;" />
					</label>
				</div>
			</fieldset>
			<div class="ag_postbuttons">
				<span>
					<input class="ag_button ag_btn_submit" type="submit" name="submit" value="##Submit##" title="##Submit##" />
				</span>
			</div>
		</form>
	</div>

	<div class="ag_rightend">
		<h2 class="ag_headerbar"><span class="ag_middle">##upload_title_3##</span></h2>
	</div>

	<div class="ag_tablewrap">
		<!--<form method="post" action="{url task=upload action=delete}" enctype="multipart/form-data">-->
		<table width="100%" border="0" cellpadding="0" cellspacing="0" id="table_sort">
			<thead>
				<tr>
					<th class="ag_spacer ag_center" width="120px" scope="row">##Preview##</th>
					<th class="ag_column ag_left" scope="row">&nbsp;&nbsp;<a href="#" onclick="return false;">##File name##</a></th>
					<th class="ag_spacer ag_center" width="60px" scope="row"><a href="#" onclick="return false;">##Date##</a></th>
					<th class="ag_spacer ag_center" width="60px" scope="row">##Action##</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="4" class="ag_spacer">
						<div id="ag_pager" class="ag_pager">
							<form action="">
								<img src="{$root_url}/style/{$style}/js_css/img/first.png" class="first" alt="##First##" title="##First##" onclick="sorter.move(-1,true)" />
								<img src="{$root_url}/style/{$style}/js_css/img/prev.png" class="prev" alt="##Previous##" title="##Previous##" onclick="sorter.move(-1)" />
								<img src="{$root_url}/style/{$style}/js_css/img/next.png" class="next" alt="##Next##" title="##Next##" onclick="sorter.move(1)" />
								<img src="{$root_url}/style/{$style}/js_css/img/last.png" class="last" alt="##Last##" title="##Last##" onclick="sorter.move(1,true)" />
								<select onchange="sorter.size(this.value)">
									<option value="5">5</option>
									<option selected="selected" value="10">10</option>
									<option value="20">20</option>
									<option value="30">30</option>
									<option value="40">40</option>
									<option value="50">50</option>
									<option value="100">100</option>
								</select>
								<span id="text">##Page## <span id="currentpage"></span>/<span id="pagelimit"></span></span>
							</form>
						</div>
					</td>
				</tr>
			</tfoot>
			<tbody>
				{foreach from=$uploads item=upload}
				<tr>
					<td class="ag_column ag_center">
						{if $upload.mini}
						<img src="{$upload.mini}" alt="" class="ag_upload_preview" />
						{/if}
					</td>
					<td class="ag_column ag_left">
						<strong>{$upload.name}</strong> <span class="ag_byuser">[{$upload.size} Kb]</span>
					</td>
					<td class="ag_column ag_left">
						{$upload.mtime}
					</td>
					<td class="ag_column ag_center">
						<img src="{image src=buttons/insert.png}" alt="" title="##Insert##" onclick="image('{$upload.path}','{$upload.name}','{$upload.mini}','{$upload.width}','{$upload.height}'); window.parent.document.getElementById('sbox-window').close();" style="cursor: pointer; " />
						{if $agora_config.o_allow_delete_attach}
						<img src="{image src=buttons/delete.png}" alt="" title="##Delete##" onclick="window.location='{url task=upload action=delete type=# id=$upload.name}'" style="cursor: pointer; " />
						{/if}
					</td>
				</tr>
				{foreachelse}
				<tr>
					<td colspan="3" class="ag_empty_forum">##no_uploads##</td>
				</tr>
				{/foreach}
			</tbody>
		</table>
		<!--</form>-->
	</div>
</div>
<script type="text/javascript">
<!--
var sorter = new TINY.table.sorter("sorter");
sorter.head = "head";
sorter.asc = "asc";
sorter.desc = "desc";
sorter.even = "evenrow";
sorter.odd = "oddrow";
sorter.evensel = "evenselected";
sorter.oddsel = "oddselected";
sorter.paginate = true;
sorter.currentid = "currentpage";
sorter.limitid = "pagelimit";
sorter.init("table_sort",1);
//-->
</script>